package com.vrp3d.domain.dto.news;

import com.vrp3d.common.consts.CommonConst;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 新增新闻dto
 *
 * @author vrp3d
 */
@Data
public class NewsInsertDTO implements Serializable {
    private static final long serialVersionUID = -3994067895236914948L;

    @ApiModelProperty(value = "类型")
    @Range(min = 1, message = "新闻类型id值最小为1")
    @NotNull(message = "新闻类型不能为空")
    private Integer type;

    @ApiModelProperty(value = "新闻标题")
    @Size(min = 1, max = CommonConst.NEWS_NAME_LENGTH, message = "新闻标题长度限制1-" + CommonConst.NEWS_NAME_LENGTH)
    @NotBlank(message = "新闻标题不能为空")
    private String title;

    @ApiModelProperty(value = "图片")
    @NotBlank(message = "新闻图片不能为空")
    private String picture;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "新闻内容")
    @NotBlank(message = "新闻内容不能为空")
    private String content;
}
